package com.x.epspace.entity;

import java.io.Serializable;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.mongodb.morphia.annotations.*;
import org.mongodb.morphia.utils.*;

/**
 * 获得并保存用户消息
 * @author chenwn
 *
 */
@Entity("messages")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_EMPTY)
@Indexes( 
		{
			@Index(fields={@Field("regUser"),@Field("bindEnt"),@Field(value="operTime",type=IndexType.DESC)}),
			@Index(fields={@Field("bindEnt"),@Field(value="scnTime",type=IndexType.DESC)})
		}
)

public class Messages extends BaseEntity implements Serializable {

	@Reference(lazy=true)
	private RegUser regUser;
	
	@Reference(lazy=true)
	private BindEnt bindEnt;
	
	/**
	 * 消息内容
	 */
	private String msg;
	
	/**
	 * 消息类别
	 */
	private String msgTypeDesc;
	
	/**
	 * 
	 * 推送时间
	 */
	private String pushTime;
	
  /**
   * 产生时间
   */
	private long scnTime;
	
	/**
	 * 操作时间
	 */
	private long operTime;

	/**
	 * 消息状态  0:未读 1：已读
	 */
	private String isRead;
	
	/**
	 * 完整消息json串
	 */
	private String msgjson;

	public RegUser getRegUser() {
		return regUser;
	}

	public void setRegUser(RegUser regUser) {
		this.regUser = regUser;
	}

	public BindEnt getBindEnt() {
		return bindEnt;
	}

	public void setBindEnt(BindEnt bindEnt) {
		this.bindEnt = bindEnt;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getMsgTypeDesc() {
		return msgTypeDesc;
	}

	public void setMsgTypeDesc(String msgTypeDesc) {
		this.msgTypeDesc = msgTypeDesc;
	}

	public String getPushTime() {
		return pushTime;
	}

	public void setPushTime(String pushTime) {
		this.pushTime = pushTime;
	}

	public long getScnTime() {
		return scnTime;
	}

	public void setScnTime(long scnTime) {
		this.scnTime = scnTime;
	}

	public long getOperTime() {
		return operTime;
	}

	public void setOperTime(long operTime) {
		this.operTime = operTime;
	}

	public String getIsRead() {
		return isRead;
	}

	public void setIsRead(String isRead) {
		this.isRead = isRead;
	}

	public String getMsgjson() {
		return msgjson;
	}

	public void setMsgjson(String msgjson) {
		this.msgjson = msgjson;
	}
	
	
	
}
